<template>
  <view>
    <view class="classifyBox" v-for="(item, index) in dataSource" :key="index">
      <div class="navTitle" @click.stop="toCat(item)">
        <span>{{ item.name }}</span>
        <span class="iconfont icon-arrow-right"></span>
      </div>
      <div class="classifyContent">
        <goodsList
          :propsData="propsData"
          :goodsList="item.goods_list"
          v-if="propsData.params.styleType == 1"
        ></goodsList>
      </div>
    </view>
  </view>
</template>

<script>
import goodsList from "../goodsList/index.vue";
export default {
  props: {
    propsData: {
      type: Object,
      default: {},
    },
    dataSource: {
      type: Array,
      default: [],
    },
  },
  components: {
    goodsList,
  },
  data() {
    return {
      goodsList: [],
    };
  },
  watch: {},
  mounted() {},
  methods: {
    // 跳转分类页面
    toCat(e) {
      uni.navigateTo({
        url: "/other/list/list?cat_id=" + e.id,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.classifyBox {
  width: 100%;
  padding-top: 16rpx;
  .navTitle {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    font-size: 28rpx;
    padding-bottom: 16rpx;
    color: #262626;
    font-family: PingFang SC;
    font-weight: 600;
    .iconfont {
      font-weight: normal;
      font-size: 22rpx;
      color: #888;
    }
  }
}
.classifyBox:first-child{
  padding-top: 0;
}
</style>